package cn.zkc.pattern.Strategy;

/**
 * @Author : kay
 * @Date : 2020-07-02 16:14
 **/

public class StrategyTest {

    public static void main(String[] args) {

        //加法测试
        Context add = new Context(new Addition());
        System.out.println("1 + 1 = "+ add.calculate(1,1));

        //乘法测试
        Context sub = new Context(new Subtraction());
        System.out.println("2 - 1 = "+ sub.calculate(2,1));

        //乘法测试
        Context mult = new Context(new Multiplication());
        System.out.println("2 * 2 = "+ mult.calculate(2,2));

        //除法测试
        Context div = new Context(new Division());
        System.out.println("4 / 2 = "+ div.calculate(4,2));


    }


}
